package assignment1;

public class Triangle extends MyShape
{   //Sub class of MyShape, calculates the area and length of a triangle.
    public double calcLength(int L)
    {   //formaula to calculate length.
        return (2*L)+Math.sqrt(2*L*L);
    }
        
    public double calcArea(int L)
    {   //formula to calculate area.
        return 0.5*L*L;
    }
}